"""
业务模型（Business DTO）
Service层使用，用于业务逻辑数据传输
"""
from dataclasses import dataclass
from typing import Optional, Dict, Any, List
import numpy as np


@dataclass
class FaceDto:
    """人脸信息DTO"""
    face_id: str
    person_id: str
    person_name: str
    quality_score: float
    face_rect: Dict[str, int]
    is_active: bool = True
    created_at: Optional[str] = None
    meta_info: Optional[Dict[str, Any]] = None


@dataclass
class FaceDetectDto:
    """人脸检测结果DTO"""
    face_rect: Dict[str, int]
    landmarks: List[List[float]]
    quality: float
    angle: Optional[float] = None


@dataclass
class FaceCompareDto:
    """人脸比对结果DTO"""
    similarity: float
    is_match: bool
    threshold: float


@dataclass
class FaceSearchResultDto:
    """人脸识别单个结果DTO"""
    face_id: str
    person_id: str
    person_name: str
    similarity: float


@dataclass
class FaceFeatureDto:
    """人脸特征DTO（内部使用）"""
    feature_vector: np.ndarray
    quality: float
    face_rect: Dict[str, int]
    landmarks: List[List[float]]
